<script>
	export default {
		onLaunch: function() {
			wx.login({
				success: (res) => {
					if (res.code) {
						this.$request(`/login`, {
							code: res.code
						}, 'POST').then(res => {
							console.log(res)
							// const { session_key, openId } = res && res.data || {}
							// uni.setStorageSync('openId', openId)
						})
					} else {
						console.log('登录失败！' + res.errMsg)
					}
				}
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "static/css/icon.scss";
	@import "static/css/gal.css";
</style>